<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('system_user', function (Blueprint $table) {
            $table->id();
            $table->string('username',20)->unique()->comment('用户名称');
            $table->string('nickname',20)->comment('用户昵称');
            $table->string('password')->comment('密码');
            $table->unsignedTinyInteger('status')->default('1')->comment('状态，1启用，0停用');
            $table->string('login_ip',30)->default('')->comment('上次登录ip');
            $table->timestamp('login_at')->nullable()->comment('上次登陆时间');
            $table->unsignedInteger('login_num')->default("0")->comment('登录次数');
            $table->timestamps();
            $table->comment('系统管理员表');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('system_user');
    }
};
